home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Gamer (Italian) 36
/
PC Gamer IT CD 36 2-2.iso
/
VIGDEMO
/
data1.cab
/
Assets
/
scripts
/
biocan.e
< prev
next >
Wrap
Text File
|
1998-09-21
|
4KB
|
594 lines
int Initialize(string type)
{
global string gMessage;
global real gInRadius = 60.0;
global real gOutRadius = 90.0;
global int gNetwork = 0;
global int state = 0;
global int hitValue = 20;
global real gTimer = 20.0;
global real gExplodeRadius = 40.0;
global int gStartSound = 45;
global int gProgressSound = 36;
global int gEndSound = 45;
global int gMsgSnd = -1;
global int gLoopSoundHandle = 0;
global real gMass = 5.0;
Reset("dummy");
return 0;
}
int Reset(string dummy)
{
CloseLowLevel();
state = 0;
wakeupTime = -1.0;
SetStyle(thisObject,0);
SetCollidableProperties(thisObject,1,0);
stopLoopSound();
return 0;
}
int exploderadius(string str)
{
gExplodeRadius = Str2Real(str);
}
int inradius(string str)
{
gInRadius = Str2Real(str);
}
int timer(string str)
{
gTimer = Str2Real(str);
}
int network(string str)
{
gNetwork = Str2Int(str);
}
int outradius(string str)
{
gOutRadius = Str2Real(str);
}
int damage(string str)
{
hitValue = Str2Int(str);
return 0;
}
int start(string dummy)
{
return 0;
}
int Explosion(int param)
{
real time ;
time = GetTime(thisObject);
state = 2;
LaunchEFX(thisObject,3,0);
Explode(thisObject,hitValue,gExplodeRadius,gMass);
SetStyle(thisObject,4);
SetCollidableProperties(thisObject,1,0);
return 0;
}
int stopLoopSound()
{
if (gLoopSoundHandle != 0)
StopSound(thisObject,gLoopSoundHandle);
gLoopSoundHandle = 0;
}
int startsound(string soundname)
{
gStartSound = GetSoundIndex(soundname);
}
int endsound(string soundname)
{
gEndSound = GetSoundIndex(soundname);
}
int msgsnd(string soundname)
{
gMsgSnd = GetSoundIndex(soundname);
}
int progresssound(string soundname)
{
gProgressSound = GetSoundIndex(soundname);
}
int Action(string dummy)
{
if (IsAuthoritative(thisObject) != 1)
return;
SendMessage(thisObject,gOutRadius,gNetwork);
PlaySound(thisObject,gMsgSnd);
OpenLowLevel ();
return 0;
}
int TimedEvent(int input)
{
return 0;
}
int OpenLowLevel ()
{
Animate(thisObject,1,"open");
AnimSetPhase(thisObject,0.0);
AnimSetDirection(thisObject,0);
PlaySound(thisObject,gStartSound);
return 0;
}
int CloseLowLevel ()
{
Animate(thisObject,1,"open");
AnimSetPhase(thisObject,1.0);
AnimSetDirection(thisObject,1);
PlaySound(thisObject,gEndSound);
return 0;
}